import { Controller, Post, Body, Get, Param, Query } from '@nestjs/common';
import { ItineraryService } from './itinerary.service';
import { GenerateItineraryDto, ItineraryResponseDto } from './itinerary.dto';

@Controller('itinerary')
export class ItineraryController {
  constructor(private readonly itineraryService: ItineraryService) {}

  // @Post('generate')
  // async generateItinerary(
  //   @Body() generateDto: GenerateItineraryDto,
  // ): Promise<ItineraryResponseDto> {
  //   return this.itineraryService.generateItinerary(generateDto);
  // }

  // @Get(':id')
  // async getItinerary(@Param('id') id: string): Promise<ItineraryResponseDto> {
  //   return this.itineraryService.getItinerary(id);
  // }

  @Get('plan')
  async generateTravelPlan(@Body() body: { destination: string; days?: number }) {
    body = { destination: '北京', days: 3 };
    return this.itineraryService.generateTravelPlan(body.destination, body.days);
  }

  @Get('search')
  async searchDestination(@Query('keyword') keyword: string) {
    // 实现目的地搜索建议
    return { results: [] };
  }
}
